
package com.x52im.rbchat.logic.sns_friend.model;

import com.x52im.rainbowchat.http.logic.dto.RosterElementEntity;
import com.x52im.rainbowchat.http.logic.dto.TimeToolKit;

/**
 * 好友请求列表中的数据对象类。
 *
 * @author JackJiang
 * @since 8.0
 */
public class FriendsReqItemValue {

    /** item的内容文本 */
    private String content = null;
    /** item的日期时间戳（GMT默认时区） */
    private long date = 0;
    /** 当前"未读"的好友请求标记（内容为"1"时表示未读，否则表示已读） */
    private boolean unread = true;
    /** 加好友请求用户的个人信息 */
    private RosterElementEntity userInfo = null;

    public FriendsReqItemValue(String content, long date, boolean unread, RosterElementEntity userInfo){
        this.content = content;
        this.date = date;
        this.unread = unread;
        this.userInfo = userInfo;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public long getDate() {
        return date;
    }

    public void setDate(long date) {
        this.date = date;
    }

    public RosterElementEntity getUserInfo() {
        return userInfo;
    }

    public void setUserInfo(RosterElementEntity userInfo) {
        this.userInfo = userInfo;
    }

    public boolean isUnread() {
        return unread;
    }

    public void setUnread(boolean unread) {
        this.unread = unread;
    }

    /**
     * date字段存放的是GMT+0时区的时间戳，UI显示时要转换成人类友好的形式哦.
     *
     * @return 转换成功则返回日期时间字串，否则返回空字符串""
     */
    public String getDateHuman() {
        return TimeToolKit.getTimeStringAutoShort2(TimeToolKit.getDateTime(date), false, false);
    }
}
